<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <h1>{{msg}}</h1>

        <button @click="reservechange">btn</button>
    </div>
</body>
<script>
    let vm = new Vue({
        el: '#app',
        data: {
            msg: 'hello'
        },
        watch: {
            msg() {
                console.log('msg改变了');
            }
        },
        methods: {
            reservechange() {
                this.msg = "hello world"
            }
        },
    })
</script>

</html>